#include "CharacterVocation.h"
#include <iostream>

const std::string Vocation::s_Weapon[WEAPON_TYPE_NUM] = { "no_weapon", "Sword", "Shield", "Dagger", "Wand", "Shortbow" };
const std::string Vocation::s_ARMOUR[ARMOUR_TYPE_NUM] = { "no_armour", "Iron", "Leather", "Textile" };

Vocation::Vocation()
{
	_major[0] = "unknown";
	for (int i = 0; i < WEAPON_MAX_PER ; i++)		
		_weapon[i] = no_weapon;
	_armour = no_armour;
}

Vocation::Vocation(string major[MAJOR_MAX_PER], WEAPON weapon[WEAPON_MAX_PER], ARMOUR armour)
{
	for (int i = 0; i < MAJOR_MAX_PER; i++)
		_major[i] = major[i];
	for (int i = 0; i < WEAPON_MAX_PER; i++)
		_weapon[i] = weapon[i];
	_armour = armour;
}

Vocation::Vocation(const Vocation & voc)
{
	for (int i = 0; i < MAJOR_MAX_PER; i++)
		_major[i] = voc._major[i];
	for (int i = 0; i < WEAPON_MAX_PER; i++)
		_weapon[i] =voc._weapon[i];
	_armour = voc._armour;
}

void Vocation::DefVocation(const string vocation)
{
	_vocation = vocation;
}

void Vocation::DefMajor(const string major[])
{
	for (int i = 0; i < MAJOR_MAX_PER; i++)
		_major[i] = major[i];
}

void Vocation::DefWeapon(const WEAPON weapon[])
{
	for (int i = 0; i < WEAPON_MAX_PER; i++)
		_weapon[i] = weapon[i];
}

void Vocation::DefArmour(const ARMOUR armour)
{
	_armour = armour;
}

void Vocation::ShowVocation() const
{
	std::cout << "Vocation : " << _vocation << std::endl;

	std::cout << "Major : " << _major[0];
	if (_major[1] != "")
		std::cout << " and " << _major[1] << std::endl;
	else
		std::cout << std::endl;

	std::cout << "Weapon : " << s_Weapon[_weapon[0]];
	if (_weapon[1] != 0)
		std::cout << " and " << s_Weapon[_weapon[1]] << std::endl;
	else
		std::cout << std::endl;

	std::cout << "Armour : " << s_ARMOUR[_armour]<<std::endl;
}

Vocation::~Vocation()
{

}